const ValidatorError = require('../../shared/errors/ValidatorError')

class SystemError extends ValidatorError {
  constructor(message, status = 400) {
    super(message)
    this.status = status
  }
}

class SystemCodeExistError extends SystemError {
  constructor() {
    super('系统编码已存在')
  }
}

class SystemNotFoundError extends SystemError {
  constructor(id) {
    super(`系统【${id}】不存在`)
  }
}

class SystemHasMenuError extends SystemError {
  constructor(name) {
    super(`系统【${name}】尚有菜单，请先删除系统菜单`)
  }
}

module.exports = {
  SystemCodeExistError,
  SystemNotFoundError,
  SystemHasMenuError,
}
